<template>
  <swiper :autoplay="autoplay">
    <swiper-item v-for="(item, index) in swiperList" :key="index">
      <slot>
        <image :src="item['image']" mode="aspectFill" />
      </slot>
    </swiper-item>
  </swiper>
</template>
<script lang="ts" setup>
interface Props {
  /**轮播列表 */
  swiperList: Record<string, any>[];
  /**自动轮播 */
  autoplay?: boolean;
}
withDefaults(defineProps<Props>(), {
  autoplay: true,
});
</script>
<style scoped>
image {
  width: 100%;
}
</style>
